﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CarAppDto.Base;
using CarAppDto.CarType.CountryDtos;
using FluentValidation;

namespace CarAppDto.CarType.BrandDtos
{
    public class ReqUpdateBrandValidator : AbstractValidator<ReqUpdateBrand>
    {
        /// <summary>
        /// 校验规则写到校验类的构造方法中
        /// </summary>
        public ReqUpdateBrandValidator()
        {
            RuleFor(x => x.Id).NotEmpty().Length(1, 36);
            RuleFor(x => x.Name).NotEmpty().Length(1, 128);
            RuleFor(x => x.Code).NotEmpty().Length(1, 20);
        }
    }

    public class ReqUpdateBrand : BaseUpdateModel
    {
        /// <summary>
        /// 品牌中文名称
        /// </summary>
        public string? Name { get; set; }

        /// <summary>
        /// 品牌英文名称
        /// </summary>
        public string? EnglishName { get; set; }

        /// <summary>
        /// 品牌代码
        /// </summary>
        public string? Code { get; set; }

        /// <summary>
        /// 品牌归宿地
        /// </summary>
        public string? BelongingPlace { get; set; }

        /// <summary>
        /// 品牌所在地（制造国）
        /// </summary>
        public string? ManufacturingCountry { get; set; }
    }
}
